<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./adminTemplate.xhtml">

            <ui:define name="title">
                Approve Company
            </ui:define>

            <ui:define name="contain">
                <h:form>
                    <h2 class="ico_mug">Request from Company</h2>                        
                    <p:dataTable var="lrt" value="#{requestController.listCom}"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="10,15,20" paginator="true" rows="10">                               
                        <p:column>  
                            <f:facet name="header">  
                                Name 
                            </f:facet>  
                            <h:outputText value="#{lrt.name}" />  
                        </p:column>                              
                        <p:column>  
                            <f:facet name="header">  
                                Contact
                            </f:facet>  
                            <h:outputText value="#{lrt.contactPerson}" />  
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Designation  
                            </f:facet>  
                            <h:outputText value="#{lrt.designation}"/>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                Address  
                            </f:facet>  
                            <h:outputText value="#{lrt.address}"/>
                        </p:column>                       
                        <p:column>  
                            <f:facet name="header">  
                                Telephone 
                            </f:facet>  
                            <h:outputText value="#{lrt.telephone}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                Fax
                            </f:facet>  
                            <h:outputText value="#{lrt.fax}" />  
                        </p:column> 
                        <p:column>  
                            <f:facet name="header">  
                                MemberType  
                            </f:facet>  
                            <h:outputText value="#{lrt.memberType}"/>
                        </p:column> 
                        <p:column style="text-align: center">  
                            <f:facet name="header">  
                                Approve  
                            </f:facet>  
                            <h:commandLink actionListener="#{requestController.updateAcceptLt(lrt.id)}">
                                <img src="img/accept.jpg" alt="accepted"/>
                            </h:commandLink>
                            <h:commandLink actionListener="#{requestController.updateDenyLt(lrt.id)}">
                                <img src="img/denied.png" alt="denied"/>
                            </h:commandLink>                            
                        </p:column> 
                    </p:dataTable>    
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
